    #include <bits/stdc++.h>
    using namespace std;
     
    #define ONLINE_JUDGE
     
    #ifndef ONLINE_JUDGE
    #define dbg(x...)                             \
    	{                                         \
    		cerr << "\033[32;1m" << #x << " -> "; \
    		err(x);                               \
    	}
    void err()
    {
    	cerr << "\033[39;0m" << endl;
    }
    template <typename T, typename... A>
    void err(T a, A... x)
    {
    	cerr << a << ' ';
    	err(x...);
    }
    #else
    #define dbg(...)
    #endif
     
    typedef long long LL;
     
    const int N = 1e5 + 50;
     
    LL maxSubSeg(int a[], int n)
    {
    	LL tans = 0, ans = 0;
    	for (int i = 0; i < n; ++i)
    	{
    		tans += a[i];
    		tans = max(tans, 0LL);
    		ans = max(ans, tans);
    	}
    	return ans;
    }
     
    int main(int argc, char const *argv[])
    {
    	int t, n;
    	static int a[N];
    	scanf("%d", &t);
    	for (int kk = 0; kk < t; ++kk)
    	{
    		scanf("%d", &n);
    		LL t2 = 0;
    		for (int i = 0; i < n; ++i)
    		{
    			scanf("%d", &a[i]);
    			t2 += a[i];
    		}
    		LL t1 = max(maxSubSeg(a, n-1), maxSubSeg(a+1, n-1));
    		if (t1 < t2) puts("YES");
    		else puts("NO");
    	}
    	return 0;
    }